package com.zqxq.lottery.mapper.user;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.zqxq.lottery.entity.po.user.UserFundsPO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.Map;

/**
 * @Description ：
 * @Author ： 解风
 * @Date ： 2018/03/13 14:39
 */
@Component(value = "userFundsMapper")
public interface UserFundsMapper extends BaseMapper<UserFundsPO> {

    Integer updateUserBalance(@Param("userId") Long userId, @Param("balance") BigDecimal balance);

    Integer updateUserBonus(@Param("userId") Long userId, @Param("bonus") BigDecimal bonus);

    Integer updateUserLotBean(@Param("userId") Long userId, @Param("lotBean") BigDecimal lotBean);

    Map<String,Object> queryUserFundsByUId(@Param("userId") Long userId);

    Map<String,Object> getById(@Param("userId") Long userId);

    UserFundsPO selectForUpdate(@Param("userId") Long userId);

    BigDecimal getTotalAmountByUserIdIn7Day(@Param("userId") Long userId,@Param("status") Integer status);
}
